From 4a58d5759478b2ceb8c9e4d2f983df09c570c042 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 20 Mar 2006 12:00:58 +0100 Subject: [PATCH] Add poll() support to xenbus device file. From: Gerd Hoffmann Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c index 9b51e4b4eb..8f748dc41d 100644 --- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c +++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "xenbus_comms.h" @@ -207,11 +208,22 @@ static int xenbus_dev_release(struct inode *inode, struct file *filp) return 0; } +static unsigned int xenbus_dev_poll(struct file *file, poll_table *wait) +{ + struct xenbus_dev_data *u = file->private_data; + + poll_wait(file, &u->read_waitq, wait); + if (u->read_cons != u->read_prod) + return POLLIN | POLLRDNORM; + return 0; +} + static struct file_operations xenbus_dev_file_ops = { .read = xenbus_dev_read, .write = xenbus_dev_write, .open = xenbus_dev_open, .release = xenbus_dev_release, + .poll = xenbus_dev_poll, }; static int __init -- 2.30.2